/*
 * @Author: zeki mini
 * @Date: 2021-01-04 16:50:17
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-06-15 15:14:21
 * @Description: 确认更换手机号
 */
import React, { Component } from 'react';
import { StyleSheet, Text, View, TouchableOpacity, SafeAreaView } from 'react-native';
import { msg, XMHeader, BackImage, Button, BackImageOn } from '@/common';
import { isAndroid, px2dp, } from '@/styles';

const { LongButton } = Button;
export default class ChangePhoneConform extends Component {
  constructor(props) {
    super(props);
    this.state = {
      buttonDisable: true,
      user: {},
    };
  }

  componentDidMount() { }

  render() {
    const { navigation } = this.props;
    const state = navigation.state || {};
    const params = state.params || {};
    const { user } = params;
    return (
      <SafeAreaView>
        <XMHeader
          title='绑定手机号'
          renderLeft={() => {
            return <BackImageOn onClick={() => { msg.emit('router: back'); }} />;
          }}
        />
        <View>
          <Text style={styles.titleStyle}>当前绑定手机号</Text>
          <Text style={styles.desxribleStyle}>{user.mobile}</Text>
        </View>
        <LongButton
          text='更换手机号'
          boxStyle={styles.bottomBtn}
          onClick={() => {
            msg.emit('router: goToNext', {
              routeName: 'ChangePhoneNew',
              user: user
            });
          }}
        />
      </SafeAreaView>
    );
  }
}
const styles = StyleSheet.create({
  titleStyle: {
    marginLeft: px2dp(32 * 2),
    marginRight: px2dp(32 * 2),
    marginTop: px2dp(60 * 2),
    fontSize: px2dp(16 * 2),
    color: '#343332',
    textAlign: 'center'
  },
  desxribleStyle: {
    fontSize: px2dp(24 * 2),
    color: '#343332',
    fontWeight: '600',
    textAlign: 'center',
    marginTop: px2dp(8 * 2),
  },
  bottomBtn: {
    marginLeft: px2dp(28 * 2),
    marginRight: px2dp(28 * 2),
    marginTop: px2dp(48 * 2),
    height: px2dp(44 * 2),
    borderRadius: px2dp(44)
  },
  buttonFalse: {
    backgroundColor: '#BA914A'
  },
  bottonTrue: {
    backgroundColor: '#BA914A'
  },
  textInputStyle: {
    fontSize: px2dp(32),
    padding: 0,
    marginTop: px2dp(32 * 2),
    marginLeft: px2dp(32 * 2),
    marginRight: px2dp(32 * 2),
    height: px2dp(44 * 2),
    borderBottomWidth: px2dp(0.4),
    borderBottomColor: '#F0EFEF',
  },
});
